#ifndef ENTITY_H_INCLUDED
#define ENTITY_H_INCLUDED

#include <iostream>
#include <list>
#include "buff.h"

class Entity
{
public:
    Entity(const std::string& _name, const int& _health, const int& _attack, const int& _defense, const int& _speed);
    virtual ~Entity() {}

    std::string getName() const { return name; }
    int getHealth() const { return currentHealth; }
    int getMaxHealth() const { return maxHealth; }
    int getAttack() const { return attack; }
    int getDefense() const { return defense; }
    int getSpeed() const { return speed; }
    int getCurrentSpeed() const { return currentSpeed; }
    bool isDead() const { return currentHealth <= 0; }

    void setCurrentSpeed(const int& i) { currentSpeed = i; }

    virtual void writeStats() const;
    virtual void startCombat();
    void takeDamage(const double& d);

    void addBuff(const Buff& b);

    void tick();

private:
    const std::string name;
protected:
    int maxHealth;
    int currentHealth;
    int attack;
    int defense;
    int speed;
    int currentSpeed;
    std::list<Buff> buffs;
};

#endif // ENTITY_H_INCLUDED
